﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Honestysoft.Financing.DataAccess;
using Honestysoft.Financing.Model;
using System.Data.Common;
using Honestysoft.BaseObject;
namespace Honestysoft.Financing.BusinessLogic
{
    public class Attach
    {
        string _connectionStringName;
        /// <summary>
        /// 构造函数，使用指定的连接字符串
        /// </summary>
        /// <param name="connectionStringName">连接字符串名称</param>
        public Attach(string connectionStringName)
        {
            _connectionStringName = connectionStringName;
        }
        /// <summary>
        /// 得到项目文件柜
        /// </summary>
        /// <param name="category"></param>
        /// <param name="sn"></param>
        /// <param name="name"></param>
        /// <param name="pageSize"></param>
        /// <param name="currentPageIndex"></param>
        /// <param name="pageCount"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public DataTable GetProjectFileCabinet(string category, string sn, string name, int pageSize, int currentPageIndex, out int pageCount, out int recordCount)
        {
            return new BD_ProjectFileCabinet_DAL(_connectionStringName).GetProjectFileCabinet(category, sn, name, pageSize, currentPageIndex, out pageCount, out recordCount);
        }
        /// <summary>
        /// 得到合同文件柜
        /// </summary>
        /// <param name="projectCategory"></param>
        /// <param name="projectSN"></param>
        /// <param name="projectName"></param>
        /// <param name="contractName"></param>
        /// <param name="pageSize"></param>
        /// <param name="currentPageIndex"></param>
        /// <param name="pageCount"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        public DataTable GetContractFileCabinet(string projectCategory, string projectSN, string projectName,string contractName, int pageSize, int currentPageIndex, out int pageCount, out int recordCount)
        {
            return new BD_ProjectFileCabinet_DAL(_connectionStringName).GetContractFileCabinet(projectCategory, projectSN, projectName, contractName, pageSize, currentPageIndex, out pageCount, out recordCount);
        }

        public DataTable GetFileCabinetTree(string parentID)
        {
            DataTable dt = new BD_ProjectFileCabinet_DAL(_connectionStringName).GetFileCabinetTree(parentID);
            return dt;
        }

    }
}
